//
//  ControlLayer.m
//  xGame
//
//  Created by Max on 11-8-28.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "ControlLayer.h"
#import "MenuLayer.h"

@implementation ControlLayer

-(id)init 
{
    if ((self=[super init])) {
        [CCMenuItemFont setFontSize:18];
        
        CCMenuItem *systemMenu = [CCMenuItemFont itemFromString:@"Menu" target:self selector:@selector(sysMenu:)];
        
        CCMenu *menu =[CCMenu menuWithItems:systemMenu, nil];
        menu.position = ccp(20, 460);
        
        [self addChild:menu z:1 tag:2];
    }
    
    return self;
}

- (void) sysMenu:(id)sender
{
    CCScene *scene =[CCScene node];
    [scene addChild:[MenuLayer node]];
    
    [[CCDirector sharedDirector] replaceScene:[CCTransitionSlideInL transitionWithDuration:1.2f scene:scene]];
}

-(void)dealloc
{
    [super dealloc];
}

@end
